home *** CD-ROM | disk | FTP | other *** search
- /*
- File: RamTupleDatabase.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __RAMTUPLEDATABASE__
- #define __RAMTUPLEDATABASE__
-
- #ifndef __BLJSTANDARDINCLUDES__
- #include "BLJStandardIncludes.h"
- #endif
-
- #ifndef __TUPLEDATABASE__
- #include "TupleDatabase.h"
- #endif
-
- /***********************************|****************************************/
-
- class CTupleEntry;
-
- class TRamTupleDatabase : public ATupleDatabase
- {
- public:
- TRamTupleDatabase ();
- virtual ~TRamTupleDatabase ();
-
- virtual Boolean SetTuple ( const ATupleKey&, const ADataItem& );
- virtual Boolean SetTuple ( unsigned long index, const ADataItem& );
-
- virtual Boolean GetTuple ( unsigned long index, ATupleKey&, ADataItem& );
- virtual Boolean GetTupleData ( const ATupleKey&, ADataItem& );
- virtual Boolean GetTupleData ( unsigned long index, ADataItem& );
- virtual Boolean GetTupleKey ( unsigned long index, ATupleKey& );
- virtual Boolean GetTupleDataSize ( const ATupleKey&, unsigned long& );
-
- virtual Boolean DeleteTuple ( const ATupleKey& );
-
- virtual Boolean FindIndexOfTuple ( const ATupleKey&, unsigned long& index ) const;
- virtual Boolean DoesTupleExist ( const ATupleKey& ) const;
- virtual unsigned long CountTuples () const;
-
- virtual void PrintSubtree ( ostream&, const CTupleEntry* root ) const;
- virtual ostream& operator >> ( ostream& ) const;
-
- private: TRamTupleDatabase ( const TRamTupleDatabase& );
- TRamTupleDatabase& operator = ( const TRamTupleDatabase& );
-
- CTupleEntry* FindTuple ( const ATupleKey& attach ) const;
- CTupleEntry* FindTuple ( unsigned long, CTupleEntry* ) const;
- CTupleEntry*& FindTuple ( const ATupleKey& attach, CTupleEntry*& parent ) const;
-
- CTupleEntry* fRoot;
- unsigned long fTupleCount;
- };
-
- /***********************************|****************************************/
-
- #endif // __RAMTUPLEDATABASE__
-